home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
smaltalk
/
st80_pr4.lha
/
st80_pre4
/
Foible
/
foible
/
edit.makecode.st
< prev
next >
Wrap
Text File
|
1993-07-24
|
2KB
|
66 lines
'GraphicEditorsOpenCodeView.st: Form-code generation by formEditor and bitEditor
Description:
This code adds an entry to the middle-mouse-button menu of both the bitEditor
and the formEditor. Besides [accept] and [cancel] you can select [code], which
will open a new window for you with Smalltalk code describing the current form
you are editing. You can copy this code and manipulate it, e.g. <display>,
<magnifyBy:>, etc.
This program is placed in the public domain. Neither I nor my company will
recognize any responsibility for damages arising from use of this program.
Pieter S. van der Meulen' !
!FormHolderView methodsFor: 'menu messages'!
openCodeView
"Open a window with a code description of the currently displayed form"
| aStream |
aStream _ WriteStream on: (String new: 1000).
displayedForm storeOn: aStream base: 10.
StringHolderView open: (StringHolder new contents: aStream contents)
label: 'Displayed Form Code'! !
!BitEditor methodsFor: 'menu messages'!
openCodeView
"Open a window with a code description of the currently displayed form"
view openCodeView! !
!BitEditor class methodsFor: 'class initialization'!
initialize
"BitEditor initialize."
YellowButtonMenu _ PopUpMenu labels:
'accept
cancel
code'.
YellowButtonMessages _ #(accept cancel openCodeView)! !
!FormEditor methodsFor: 'menu messages'!
openCodeView
"Open a window with a code description of the currently displayed form"
view updateDisplay.
view openCodeView! !
!FormEditor class methodsFor: 'class initialization'!
initialize
"FormEditor initialize."
FlashCursor _ false.
self setKeyboardMap.
YellowButtonMenu _ PopUpMenu labels:
'accept
cancel
code'.
YellowButtonMessages _ #(accept cancel openCodeView)! !
BitEditor initialize.
FormEditor initialize!